
package com.wy2cloud.jpa;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 系统名称 xx平台
 * 工程名称 wy2-cloud
 * 创建时间 2017/8/8 11:53
 *
 * @author admin
 * @since 1.8
 */
@Configuration
@ConditionalOnClass(JpaService.class)
@EnableConfigurationProperties(JpaServiceProperties.class)
public class JpaAutoConfigure {

    @Autowired
    private JpaServiceProperties properties;

    @Bean
    @ConditionalOnMissingBean
    @ConditionalOnProperty(prefix = "wy2cloud.jpa",value = "enabled",havingValue = "true")
    JpaService jpaService (){
        return  new JpaService();
    }


}